package com.master.demo.common.enums;

import lombok.Getter;

/**
 * 登陆类型
 *
 * @author: Yang
 * @date: 2023/9/9
 * @version: 1.0.0
 * Copyright Ⓒ 2022 Master Computer Corporation Limited All rights reserved.
 */
@Getter
public enum LoginTypeEnum {

    /**
     * 登陆类型 1 帐号密码登陆 2 手机验证码登陆 3 微信登陆 4 支付宝登陆 5 钉钉登陆
     */
    USERNAME("帐号密码登陆", 1),

    TEL("手机验证码登陆", 2),

    WX("微信登陆", 3),

    ALI("支付宝登陆", 4),

    DINGDING("钉钉登陆", 5);


    private final Integer value;

    private final String label;

    LoginTypeEnum(final String label, final Integer value) {
        this.label = label;
        this.value = value;
    }

    /**
     * 普通方法
     *
     * @param code
     * @return
     */
    public static LoginTypeEnum getEnum(Integer value) {
        for (LoginTypeEnum v : LoginTypeEnum.values()) {
            if (value.equals(v.value)) {
                return v;
            }
        }
        return null;
    }

}
